package com.yonyou.pmclouds.project.mapper;

import com.yonyou.pmclouds.basecom.dao.BaseMapper;
import com.yonyou.pmclouds.basecom.entity.KeyCountVO;
import com.yonyou.pmclouds.project.entity.ProjectBillVO;
import com.yonyou.pmclouds.team.entity.TeamMemberVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ProjectBillMapper extends BaseMapper<ProjectBillVO> {
    KeyCountVO[] countProjectBillCountExcludeType(@Param("projects") String[] projects, @Param("billTypes") String[] billTypes,
                                                  @Param("noneStatusBillTypes") String[] noneStatusBillTypes,
                                                  @Param("timeStart") Date timeStart, @Param("timeEnd") Date timeEnd,
                                                  @Param("start") int start, @Param("offset") int offset);

    int countBillCountExcludeType(@Param("projects") String[] projects, @Param("billTypes") String[] billTypes,
                                  @Param("noneStatusBillTypes") String[] noneStatusBillTypes,
                                  @Param("start") Date start, @Param("end") Date end);

    ProjectBillVO[] queryBillCountExcludeType(@Param("projects") String[] projects, @Param("billTypes") String[] billTypes,
                                              @Param("noneStatusBillTypes") String[] noneStatusBillTypes,
                                              @Param("start") Date start, @Param("end") Date end);

    KeyCountVO[] queryBillTypeCountExcludeType(@Param("project") String project, @Param("billTypes") String[] billTypes,
                                               @Param("noneStatusBillTypes") String[] noneStatusBillTypes,
                                               @Param("start") Date start, @Param("end") Date end);

    KeyCountVO[] countByProjectTeamMember(@Param("members") TeamMemberVO[] memberVOs, @Param("billTypes") String[] billTypes,
                                          @Param("noneStatusBillTypes") String[] noneStatusBillTypes,
                                          @Param("start") Date start, @Param("end") Date end);

    KeyCountVO[] countByMemberInProjects(@Param("members") String[] members, @Param("projects") String[] projects,
                                         @Param("billTypes") String[] billTypes, @Param("noneStatusBillTypes") String[] noneStatusBillTypes,
                                         @Param("start") Date start, @Param("end") Date end);

    List<ProjectBillVO> queryByCreatorOfProjects(@Param("members") String[] members, @Param("projects") String[] projects,
                                                 @Param("billTypes") String[] billTypes, @Param("noneStatusBillTypes") String[] noneStatusBillTypes,
                                                 @Param("start") Date start, @Param("end") Date end);

    List<ProjectBillVO> queryByIncludeTypeAndStatus(@Param("projects") String[] projects, @Param("billTypes") String[] billTypes, @Param("billStatus") Byte[] billStatus);


}
